<template>
  <view class="leave-card">
    <view class="card-header">
      <view class="card-title">{{ studentLeave.subject }}</view>
      <view class="card-subtitle">
        <text>学生：{{ studentLeave.studentName }}</text>
      </view>
    </view>

    <view class="card-content">
      <view class="content-item">
        <text class="item-label">请假时间:</text>
        <text class="item-value">{{ studentLeave.leaveTime }}</text>
      </view>
      <view class="content-item">
        <text class="item-label">请假原因:</text>
        <text class="item-value">{{ studentLeave.remark }}</text>
      </view>
    </view>
  </view>
</template>

<script setup lang="ts">
import { defineProps, defineEmits } from 'vue'
import type { StudentLeaveItem } from '@/types/studentLeave'
defineProps<{
  studentLeave: StudentLeaveItem
}>()
</script>
<style scoped>
.leave-card {
  background-color: #fff;
  border-radius: 16rpx;
  box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.08);
  margin: 20rpx;
  overflow: hidden;
  transition: all 0.3s ease;
}

.leave-card:active {
  transform: scale(0.98);
}

.card-header {
  padding: 30rpx 30rpx 20rpx;
  background-color: #f8fafc;
  border-bottom: 1rpx solid #f0f2f5;
}

.card-title {
  font-size: 36rpx;
  font-weight: bold;
  color: #333;
  margin-bottom: 10rpx;
}

.card-subtitle {
  font-size: 28rpx;
  color: #666;
}

.card-content {
  padding: 25rpx 30rpx;
}

.content-item {
  display: flex;
  margin-bottom: 20rpx;
  align-items: center;
}

.content-item:last-child {
  margin-bottom: 0;
}

.item-label {
  width: 180rpx;
  font-size: 28rpx;
  color: #999;
}

.item-value {
  flex: 1;
  font-size: 28rpx;
  color: #333;
  line-height: 1.5;
}
</style>
